import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkYueJuDemoVO, SkYueJuDemoForm, SkYueJuDemoQuery } from '@/api/app/SkYueJuDemo/types';

/**
 * 查询约局模版列表
 * @param query
 * @returns {*}
 */

export const listSkYueJuDemo = (query?: SkYueJuDemoQuery): AxiosPromise<SkYueJuDemoVO[]> => {
  return request({
    url: '/app/SkYueJuDemo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询约局模版详细
 * @param id
 */
export const getSkYueJuDemo = (id: string | number): AxiosPromise<SkYueJuDemoVO> => {
  return request({
    url: '/app/SkYueJuDemo/' + id,
    method: 'get'
  });
};

/**
 * 新增约局模版
 * @param data
 */
export const addSkYueJuDemo = (data: SkYueJuDemoForm) => {
  return request({
    url: '/app/SkYueJuDemo',
    method: 'post',
    data: data
  });
};

/**
 * 修改约局模版
 * @param data
 */
export const updateSkYueJuDemo = (data: SkYueJuDemoForm) => {
  return request({
    url: '/app/SkYueJuDemo',
    method: 'put',
    data: data
  });
};

/**
 * 删除约局模版
 * @param id
 */
export const delSkYueJuDemo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkYueJuDemo/' + id,
    method: 'delete'
  });
};
